﻿@using GuRenFang.Common
@model GuRenFang.Service.Entity.Pager<GuRenFang.Service.Entity.Messages>
@{
    ViewBag.Title = "List";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="grid_16 widget first">
    <div class="widget_title clearfix">
        <h2>
            留言消息列表</h2>
    </div>
    <div class="widget_body">
        <div id="table1">
            <div class="dataTables_wrapper">                
                <table class="dataTable">
                    <thead>
                        <tr class="odd">                            
                            <th class="align-left ui-state-default" rowspan="1" colspan="1" style="width: 150px;">
                                <div class="DataTables_sort_wrapper">
                                    标题<span class="DataTables_sort_icon css_right ui-icon ui-icon-carat-2-n-s"></span></div>
                            </th>
                            <th class="align-left ui-state-default" rowspan="1" colspan="1" style="width: 370px;">
                                <div class="DataTables_sort_wrapper">
                                    内容<span class="DataTables_sort_icon css_right ui-icon ui-icon-carat-2-n-s"></span></div>
                            </th>
                            <th class="align-left ui-state-default" rowspan="1" colspan="1" style="width: 80px;">
                                <div class="DataTables_sort_wrapper">
                                    称呼<span class="DataTables_sort_icon css_right ui-icon ui-icon-carat-2-n-s"></span></div>
                            </th>
                            <th class="align-left ui-state-default" rowspan="1" colspan="1" style="width: 100px;">
                                <div class="DataTables_sort_wrapper">
                                    联系方式<span class="DataTables_sort_icon css_right ui-icon ui-icon-carat-2-n-s"></span></div>
                            </th>
                            <th class="ui-state-default" rowspan="1" colspan="1" style="width: 120px;">
                                <div class="DataTables_sort_wrapper">
                                    创建时间<span class="DataTables_sort_icon css_right ui-icon ui-icon-carat-2-n-s"></span></div>
                            </th>
                            <th class="ui-state-default" rowspan="1" colspan="1" style="width: 30px;">
                                <div class="DataTables_sort_wrapper">
                                    操作<span class="DataTables_sort_icon css_right ui-icon ui-icon-carat-2-n-s"></span></div>
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var item in Model.DataSource)
                        {
                            <tr>                               
                                <td>
                                    @Html.Raw(Html.RemoveHtmlTag(item.Title))
                                </td>
                                <td>
                                    @Html.Raw(Html.RemoveHtmlTag(item.Content))
                                </td> 
                                <td>
                                    @item.SenderName
                                </td> 
                                <td>
                                    @item.SenderEmail
                                </td>                               
                                <td class="center">
                                    @item.CreatedTime
                                </td>
                                <td class="center">
                                    <ul class="hor-list piped">                                        
                                        <li>@Html.ActionLink("删除", "Delete", "MessageAdmin", new { id = item.Id }, new { target = "_self",data="delete" })</li></ul>
                                    
                                </td>
                            </tr>
                        }
                    </tbody>
                </table>
                @Html.Partial("_AdminPager", Model.Item)
            </div>
            <div class="clear">
            </div>
        </div>
    </div>
    </div>
    <script type="text/javascript">
        $(document).ready(function () {
            $(".dataTable ul li a[data='delete']").click(function() {
                return confirm("确定真的要删除改记录吗？");

            });
        })
    
    </script>
